package com.ibm.cps.sql.expression;

import java.util.HashSet;
import java.util.Set;

import com.ibm.util.exception.CPSException;

public class NumberNode implements ValueExpression {
	private double value;
	
	public NumberNode() {
		//Only used for serialization
	}

	public NumberNode(double value) {
		this.value = value;
	}

	@Override
	public String toString() {
		return "{\"NumberNode\":{\"value\":\"" + value + "\"}}";
	}

	@Override
	public Set<String> collectVariableNames() {
		return new HashSet<>();
	}

	public double getValue() {
		return value;
	}
	
	public void setValue(double value) {
		this.value = value;
	}

	@Override
	public Object evaluate(FieldEvaluator evaluator) throws CPSException {
		return value;
	}

	@Override
	public void updateVariableName(String original, String fullQualifiedName) {
	}

}
